<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('修改员工属性变更登记')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-AttributeChange-edit" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${AttributeChangeData.id}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input th:value="${AttributeChangeData.badge}" class="form-control" readonly="readonly"
                               type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <input th:value="${AttributeChangeData.name}" class="form-control" readonly="readonly"
                               type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${AttributeChangeData.compName}" class="form-control" readonly="readonly"
                               type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">部门名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${AttributeChangeData.depName}" class="form-control" readonly="readonly"
                               type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${AttributeChangeData.jobName}" class="form-control" readonly="readonly"
                               type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">修改信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>属性变动类型：</label>
                    <div class="col-sm-8">
                        <select name="empchangetype" id="empchangetype" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_EmpChangeType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:selected="${AttributeChangeData.empchangetype+'' == dict.dictValue}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>属性变动原因：</label>
                    <div class="col-sm-8">
                        <select name="empchangereason" id="empchangereason" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_EmpChangeReason')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:selected="${AttributeChangeData.empchangereason+'' == dict.dictValue}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>新工作城市：</label>
                    <div class="col-sm-8">
                        <input name="NewWorkCityName" id="NewWorkCityName"
                               th:value="${AttributeChangeData.NewWorkcityName}" onclick="getWorkCity()"
                               class="form-control"
                               type="text" required>
                        <input name="NewWorkCity" id="NewWorkCity" th:value="${AttributeChangeData.newWorkcity}"
                               class="form-control" type="hidden">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">新集团高管发薪状态：</label>
                    <div class="col-sm-8">
                        <select name="newEmpCustom1" id="newEmpCustom1" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_EmpCustom1')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:selected="${AttributeChangeData.newEmpCustom1+'' == dict.dictValue}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">新直接上级：</label>
                    <div class="col-sm-8">
                        <input name="NewReportToName" id="NewReportToName"
                               th:value="${AttributeChangeData.NewReportToName}" onclick="getNewReportTo()"
                               type="text"
                               class="form-control" />
                        <input name="NewReportTo" id="NewReportTo" th:value="${AttributeChangeData.NewReportTo}"
                               type="hidden"
                               class="form-control" />
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">新职能上级：</label>
                    <div class="col-sm-8">
                        <input name="NewWfReportToName" id="NewWfReportToName" onclick="getNewWFReportTo()"
                               th:value="${AttributeChangeData.NewWfReportToName}" type="text"
                               class="form-control">
                        <input name="NewWfReportTo" id="NewWfReportTo" th:value="${AttributeChangeData.NewWfReportTo}"
                               type="hidden" class="form-control">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">新发薪公司：</label>
                    <div class="col-sm-8">
                        <select id="newSalaryComp" name="newSalaryComp" class="form-control">
                            <option value="">请选择</option>
                            <option th:each="company:${companys}" th:value="${company.compID}"
                                    th:text="${company.title}"
                                    th:selected="${AttributeChangeData.newSalarycomp==company.compID}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>生效日期：</label>
                    <div class="col-sm-8">
                        <input name="EffectDate" id="EffectDate" th:value="${AttributeChangeData.EffectDate}"
                               type="text"
                               class="form-control laydate-demo-1"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="Remark" id="Remark" th:value="${AttributeChangeData.Remark}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "changeManage/AttributeChange";


    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
    });


    function getWorkCity() {
        $.modal.open("选择新工作城市", prefix + "/getWorkCity");
    }

    function getNewReportTo() {
        $.modal.open("选择新直接上级", prefix + "/getNewReportTo?type=ReportTo");
    }

    function getNewWFReportTo() {
        $.modal.open("选择新职能上级", prefix + "/getNewReportTo?type=WFReportTo");
    }


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-AttributeChange-edit").serializeArray();
            $.operate.save(prefix + "/edit", data);
        }
    }

</script>


</body>
</html>